import Mock from 'mockjs2'
import { builder } from '../util'

const spaceList = options => {
  console.log('options', options)
  const data = [
	  {
		id: 1,
		name: '知识库'
	  },
	  {
	  		id: 2,
	  		name: 'coldleaf-wiki'
	  }
  ]
  return builder(data)
}
const getSpace = options => {
  console.log('options', options)
  const data = {
		id: 1,
		name: '知识库'
	  }
  return builder(data)
}

const saveSpace = options => {
  console.log('options', options)
  return builder(null)
}
  
Mock.mock(/\/api\/space\/searchList/, 'get', spaceList)
Mock.mock(/\/api\/space\/get/, 'get', getSpace)
Mock.mock(/\/api\/space\/save/, 'post', saveSpace)
Mock.mock(/\/api\/space\/modify/, 'post', saveSpace)
Mock.mock(/\/api\/space\/remove/, 'post', saveSpace)
